cmake_minimum_required(VERSION 3.10)

project(http_manager)
set(CXX_STANDARD 11)
# 添加libs目录作为库目录
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs")
set(OPENSSL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libs/include") 
set(OPENSSL_CRYPTO_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/libs/libcrypto.so.3")
set(OPENSSL_SSL_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/libs/libssl.so.3")
add_definitions(-DCPPHTTPLIB_OPENSSL_SUPPORT)
aux_source_directory(src SOURCES)
add_library(http_manager SHARED ${SOURCES})

target_include_directories(http_manager PUBLIC include  ${OPENSSL_INCLUDE_DIR})

target_link_libraries(http_manager
    PUBLIC
    ${OPENSSL_SSL_LIBRARY}
    ${OPENSSL_CRYPTO_LIBRARY}
)
target_compile_definitions(http_manager PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT)
add_executable(http_test1 http_test1.cpp)
target_link_libraries(http_test1 http_manager)

add_executable(http_test2 http_test2.cpp)
target_link_libraries(http_test2 http_manager)

add_executable(http_test3 http_test3.cpp)
target_link_libraries(http_test3 http_manager)

add_executable(http_test4 http_test4.cpp)
target_link_libraries(http_test4 http_manager)

add_executable(http_test5 http_test5.cpp)
target_link_libraries(http_test5 http_manager)

add_executable(http_test6 http_test6.cpp)
target_link_libraries(http_test6 http_manager)

add_executable(http_test7 http_test7.cpp)
target_link_libraries(http_test7 http_manager)

add_executable(http_test8 http_test8.cpp)
target_link_libraries(http_test8 http_manager)

add_executable(http_test9 http_test9.cpp)
target_link_libraries(http_test9 http_manager)

add_executable(http_test10 http_test10.cpp)
target_link_libraries(http_test10 http_manager)